var specificUl = document.querySelector('#Specific_ul');
var specificUlList = new Array(9);
for (var i = 0; i < specificUlList.length; i++) {
    var newli = `<li>
                <div class="Specific_text">
                    <a href="../job/collection_position_alert.html">
                        <p class="jobname">
                            Java技术专家/高级专家(J13210)
                            <span>40-70K·14薪</span>
                        </p>
                        <p class="job_text">
                            北京
                            <span class="vline"></span>
                            3-5年
                            <span class="vline"></span>
                            本科
                        </p>
                    </a>
                    <a href="../job/collection_position_alert.html" class="user-info">
                        <p>
                            <img src="../images/jkf_imgs/user01.jpg" alt="">
                            美莱网
                            <span class="user-text">
                                    赵女士
                                    <span class="vline"></span>
                                    高级招聘经理
                                </span>
                        </p>
                    </a>
                </div>
                </li>`;
    specificUl.innerHTML += newli;
}

var companyUl = document.querySelector("#companyUl");
var companyUlList = new Array(12);
for (var i = 0; i < companyUlList.length; i++) {
    var companyli = `<li>
                    <div class="Specific_text">
                        <a href="https://www.zhipin.com/gongsi/fa2f92669c66eee31Hc~.html?ka=index_rcmd_companylogo_1_custompage" class="company-info">
                            <img src="../images/jkf_imgs/companylogo.jpg" alt="">
                            <div class="company-text">
                                <h4>公司名称</h4>
                                <p>
                                    B轮
                                    <span class="vline"></span>
                                    公司类型
                                </p>
                            </div>
                        </a>
                        <a href="" class="about-info">
                            <span class="text-green">12</span>
                            个热招职位
                        </a>
                    </div>
                </li>`;
    companyUl.innerHTML += companyli;
}


var choicePosition = document.querySelector(".choice_position");
choicePosition.onclick = function (event) {
    var lis = choicePosition.children;
    // console.log(lis);
    var element = event.target;
    // console.log(element);
    if (element.nodeName.toLowerCase() === 'li') {
        for (var li of lis) {
            // li.firstElementChild.className=null;

            li.setAttribute("class", "");
        }
        element.setAttribute("class", "choose");//赋予点击标签属性
    }
}

var choiceComType = document.querySelector('#choice_companyType');
choiceComType.onclick = function (event) {
    var lis = choiceComType.firstElementChild.children;
    //找到div下的ul
    // console.log(lis);
    var element = event.target;
    // console.log(element.nodeName.toLowerCase());
    if (element.nodeName.toLowerCase() === 'li') {
        for (var li of lis) {
            // li.firstElementChild.className=null;
            li.setAttribute("class", "");
        }
        element.setAttribute("class", "choose");//赋予点击标签属性
    }
}